﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Tab2Sql.Forms
{
    /// <summary>
    /// This form allows the user to input (very limited) custom string replacement which allows the input string
    /// to be cleaned/adjusted before you run tab2sql to convert to sql statements.
    /// </summary>
    public partial class CustomReplace : Form
    {


        private string searchPattern;
        /// <summary>
        /// The text you want to find.
        /// </summary>
        public string SearchPattern
        {
            get { return Search.Text; }
            set { searchPattern = value; }
        }

        private string replacePattern;

        public string ReplacePattern {
            get {
                return this.replacePattern;
            }
            set {
                replacePattern = value;
            }
        }

        /// <summary>
        /// Constructor for CustomReplace form.
        /// </summary>
        /// <param name="token">
        /// A <see cref="System.String"/>
        /// </param>
        public CustomReplace(ref string token)
        {
            searchPattern = string.Empty;
            InitializeComponent();


        }

        private void button1_Click (object sender, EventArgs e)
        {
            searchPattern = Search.Text;
            this.Hide ();

            
        }
        /// <summary>
        /// Closes form from it's parent.
        /// </summary>
        public void RemoteClose()
        {
            this.Close();
        }

        private void CustomReplace_Load(object sender, EventArgs e)
        {

        }


    }
}
